#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long Ull;
typedef pair<int,int> PII;
const int INF=0x3f3f3f3f;
const int N=110;
int b[N][N];
int a[N][N];
int main()
{
	int n,m;
	cin>>n>>m;
	int t;
	cin>>t;
	int x,y,x1,y1;
	while(t--)
	{
		cin>>x>>y>>x1>>y1;
		a[x][y]++;
		a[x1+1][y1+1]++;
		a[x1+1][y]--;
		a[x][y1+1]--;
	}
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			b[i][j]=b[i-1][j]+b[i][j-1]+a[i][j]-b[i-1][j-1];
			if(b[i][j]>0)
			{
				ans++;
			}
		}
	}
	cout<<n*m-ans;

	return 0;
}

